<template>
  <div class="p-4">
    <p v-if="qctable === undefined || qctable === null">没有任何数据</p>
    <table v-else>
      <thead v-for="row in qctable.headerRows">
        <th v-for="cell in row.cells" :colspan="cell.colspan" :rowspan="cell.rowspan">{{
          cell.text
        }}</th>
      </thead>

      <tbody>
        <tr v-for="row in qctable.bodyRows">
          <td v-for="cell in row.cells" :colspan="cell.colspan" :rowspan="cell.rowspan">{{
            cell.text
          }}</td>
        </tr>
      </tbody>
    </table>
  </div>
</template>
<script lang="ts">
  import { defineComponent, ref, reactive, onBeforeMount, onUnmounted, computed } from 'vue';

  export default defineComponent({
    name: 'QcTable',
    components: {},
    //子组件中使用props接收父组件传递的数据，可以直接使用
    props: {
      title: {},
      qctable: {},
    },
    setup() {
      onBeforeMount(() => {
        console.log('QcTable.vue onBeforeMount');
      });
      onUnmounted(() => {
        console.log('QcTable.vue onUnmounted');
      });

      return {};
    },
  });
</script>
<style scoped lang="less"></style>
